# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Mosra <mosra@centrum.cz>

pkgname=magnum
pkgver=2019.10
pkgrel=1
pkgdesc='C++11/C++14 graphics middleware for games and data visualization'
arch=(x86_64)
url='https://magnum.graphics'
license=(MIT)
depends=("corrade>=$pkgver" openal glfw sdl2 vulkan-icd-loader)
makedepends=(cmake git ninja)
optdepends=('magnum-plugins: import and export features')
source=("git+https://github.com/mosra/magnum.git#tag=v$pkgver")
sha256sums=('SKIP')

build() {
  mkdir -p build
  cd build
  cmake "$srcdir/magnum" \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wfatal-errors" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DWITH_AL_INFO=ON \
    -DWITH_ANYAUDIOIMPORTER=ON \
    -DWITH_ANYIMAGECONVERTER=ON \
    -DWITH_ANYIMAGEIMPORTER=ON \
    -DWITH_ANYSCENEIMPORTER=ON \
    -DWITH_AUDIO=ON \
    -DWITH_DISTANCEFIELDCONVERTER=ON \
    -DWITH_GLXAPPLICATION=ON \
    -DWITH_GLXCONTEXT=ON \
    -DWITH_IMAGECONVERTER=ON \
    -DWITH_MAGNUMFONT=ON \
    -DWITH_MAGNUMFONTCONVERTER=ON \
    -DWITH_OBJIMPORTER=ON \
    -DWITH_FONTCONVERTER=ON \
    -DWITH_GL_INFO=ON \
    -DWITH_GLFWAPPLICATION=ON \
    -DWITH_SDL2APPLICATION=ON \
    -DWITH_TGAIMAGECONVERTER=ON \
    -DWITH_TGAIMPORTER=ON \
    -DWITH_VK=ON \
    -DWITH_WAVAUDIOIMPORTER=ON \
    -DWITH_WINDOWLESSGLXAPPLICATION=ON \
    -GNinja
  ninja
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
  install -Dm644 magnum/COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}


# getver: github.com/mosra/magnum/releases/latest
# vim: ts=2 sw=2 et:
